package com.jh.user.business;

import cn.jh.common.exception.ServiceException;
import com.jh.user.pojo.*;
import com.jh.user.service.BrandRateRequest;
import com.jh.user.service.UserChannelRequest;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

public interface ChannelRateBusiness {

	BrandRate queryBrandRate (String channelId, String payType,String grade);

	public Channel  mergeChannel(Channel channel);


	public Channel  findChannelByTag(String channelTag);

	public ChannelRate findAllChannelRate(long userId,long type,String channelType);

	public Channel  findChannelById(long channelid);

	public List<Channel> findAllChannel();


	public List<Channel> findAllChannel(long userId,long payType,long channelType,String amountMoney,String type);

	public List<Channel> findAllChannelByBrandid(long brandid);


	public ChannelRate mergeChannelRate(ChannelRate channelRate);


	public ChannelRate findChannelRateByUserid(long userid,long channelId);


	public  List<ChannelRate>  findChannelRateByBrandid(long brandid,  long channelid);


	public List<ChannelRate>  findChannelRates();

	public List<Channel> findChannelByChannelNo(String channelNo);

	//通过brandid和channelid查询ChannelRate,把minrate的值赋给rate
	public void  updChannelRateBybrandidAndChannelidanduserId(BigDecimal minrate, long brandid,  long channelid,long userid);


	public Channel findByChannelId(long channelId);

	List<Channel> findAll(String grade);

	List<Channel> findRateByChannel(String grade,String channelMerType);

	List<Channel> findRate(String grade,String payType);

	/**
	 * 查询用户的通道费率信息
	 *
	 * @param userId 用户id
	 * @return 返回用户通道费率信息
	 */
	List<UserChannelRate> findUserChannelRate(Long userId);

	List<ChannelRate> findChannelRateListByUserId(long userId);

	void updateChannelByChannelIdAndPayType(long channelId, Short payType, BigDecimal gradeRate);

	/**
	 * 更新用户通道费率信息
	 *
	 * @param userChannelRequest 请求参数封装对象
	 * @throws ServiceException 业务异常时抛出
	 */
	ChannelRate updateUserChannelRate(UserChannelRequest userChannelRequest) throws ServiceException;

	Map<String, Object> saveOfUpdateChannelInfo(String operating, ChannelRequest channelRequest, Channel channel) throws ServiceException;

	List<Map<String, Object>> queryAllChannel() throws ServiceException;

    Map<String, Object> editBrandRate(long brnadId, String channelNo, String payType, BigDecimal brandRate) throws ServiceException;

    BrandRate addBrandRate(BrandRateRequest brandRateRequest, BigDecimal brandrate) throws ServiceException;

    void queryByUserId(long userId, long brandId, long grade) throws ServiceException;
}
